<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="app">
    <cpn1></cpn1>
    <cpn2></cpn2>
</div>

<script src="../../js/vue.js"></script>
<script>
    /* 一. 全局组件注册的语法糖*/
    /* 1. 创建组件构造器*/
    /* 2.注册组件*/
    Vue.component('cpn1', {
        template: `
        <div>
            <h2>我是标题</h2>
            <p>我是内容111</p>
        </div>
        `
    })

    const app = new Vue({
        el: '#app',
        data: {
            message: '你好啊'
        },
        components: {
            'cpn2': {
                template: `
                    <div>
                        <h2>我是标题111</h2>
                        <p>我是内容222</p>
                    </div>
                    `
            }
        }
    })
</script>

</body>
</html>